<?php
/*
Barcode Render Class for PHP using the GD graphics library 
Copyright (C) 2001  Karim Mribti

   Version  0.0.7a  2001-04-01  

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
																  
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.
											   
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
																		 
Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser.txt
													 
Source code home page: http://www.mribti.com/barcode/
Contact author at: barcode@mribti.com
*/

  // ini_set("allow_call_time_pass_reference", true);
  // image.php?code=0123456789&style=68&type=I25&width=180&height=120&xres=2&font=5

  define ("__TRACE_ENABLED__", false);
  define ("__DEBUG_ENABLED__", false);
  
  $code = isset($_GET['code']) ? $_GET['code'] : "0000000";

  require("barcode.php");
  require("c128aobject.php");

  $style = isset($_GET['style']) ? (int)$_GET['style'] : BCD_DEFAULT_STYLE;
  $width = isset($_GET['width']) ? (int)$_GET['width'] : BCD_DEFAULT_STYLE;
  $height = isset($_GET['height']) ? (int)$_GET['height'] : BCD_DEFAULT_HEIGHT;
  $xres = isset($_GET['xres']) ? (int)$_GET['xres'] : BCD_DEFAULT_XRES;
  $font = isset($_GET['font']) ? (int)$_GET['font'] : BCD_DEFAULT_FONT;

  $type = "C128A";

  $obj = new C128AObject($width, $height, $style, $code);

  if ($obj)
  {
      $obj->SetFont($font);   
      $obj->DrawObject($xres);
  	  $obj->FlushObject();
  	  $obj->DestroyObject();
  	  unset($obj); /* clean */
  }

?>